﻿using System;
using System.Drawing;
using System.Windows.Forms;
using Alexus.DDrawScene;
using Alexus.DDrawScene.PaintJobs;

namespace Alexus.HowTo
{
	public partial class Form1 : Form
	{
		Scene _scene;
		public Form1()
		{
			InitializeComponent();
		}
		protected override void OnLoad(EventArgs e)
		{
			base.OnLoad(e);
			_scene = new Scene(Properties.Resources.Водяные_лилии, panel1);

			// дальше - необязательный код для понтов.
			PaintJob pj1 = new PJGliph(Properties.Resources.GlassBall_green_i, new RectangleF(0.2F, 0.2F, 0.3F, 0.3F));
			PaintJob pj2 = new RectanglePaintJob(new RectangleF(0.1F, 0.1F, 0.5F, 0.5F), Color.MistyRose);
			pj2.timeToLive = TimeSpan.FromSeconds(5);
			_scene.AddPaintJob(pj1);
			_scene.AddPaintJob(pj2);
		}

		protected override void OnPaint(PaintEventArgs e)
		{
			base.OnPaint(e);
			_scene.Draw();
		}

	}

}
